import { useEffect } from 'react';
import '../style/globals.css';

function MyApp({ Component, pageProps }: any) {
  useEffect(() => {
    const handleFormSubmit = (event: any) => {
      if (event?.target?.tagName === 'FORM') {
        event.preventDefault();
      }
    };

    document.addEventListener('submit', handleFormSubmit);

    // Cleanup the event listener on component unmount
    return () => {
      document.removeEventListener('submit', handleFormSubmit);
    };
  }, []);

  return <Component {...pageProps} />;
}

export default MyApp;
